/* 导入Google字体Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap');

/* === 全局变量 === */
:root {
    --breakpoint-mobile: 768px;
    --breakpoint-tablet: 1024px;
}

/* === 基础重置与字体 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f2f5;
    font-size: 16px;
}

.dialog-footer {
    flex-direction: column;
}

.dialog-footer .el-button {
    width: 100%;
    margin-bottom: 10px;
}
/* === 响应式布局通用类 === */

/* 容器 */
.container {
    padding: 15px;
    max-width: 100%;
    margin: 0 auto;
}

/* 卡片 */
.main-card {
    margin-bottom: 20px;
}
/* === 通用卡片响应式样式 === */
.card-col {
    margin-bottom: 20px;
}

.chart-card {
    width: 100%;
}
/* 搜索区域 */
.search-section {
    background-color: #f5f7fa;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* 表格响应式包裹 */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.table-wrapper table {
    min-width: 800px;
}

/* 移动端隐藏 */
.mobile-hidden {
    display: none !important;
}
/* === 通用图表容器响应式样式 === */
.chart-container {
    height: 300px;
    width: 100%;
}
/* === 通用搜索区域响应式样式 === */
.search-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.search-section .el-input,
.search-section .el-select {
    flex: 1;
    min-width: 120px;
}

.search-section .el-button {
    white-space: nowrap;
}
/* === 通用搜索和操作区域响应式样式 === */
.search-and-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

/* === 通用搜索控件样式 === */
.search-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-input {
    width: 150px;
}

.filter-select {
    width: 150px;
}

/* === 通用导出按钮样式 === */
.export-button {
    align-self: flex-end;
}

/* === 通用表格容器样式 === */
.clocking-table {
    min-width: 400px;
}
/* === 通用AI聊天窗口样式 === */
.ai-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.ai-chat-container {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: white;
    z-index: 10001;
    position: absolute;
    cursor: move;
    user-select: none;
    transition: width, height 0.2s ease;
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #545c64;
    color: white;
    font-weight: bold;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* 通用关闭按钮样式 */
.close-btn {
    background: transparent !important;
    border: none !important;
    color: white !important;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* 通用模型选择器样式 */
.model-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.model-cards {
    display: flex;
    gap: 8px;
}

.model-card {
    padding: 6px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background: #f5f7fa;
}

.model-card.active {
    border-color: #409eff;
    background: #ecf5ff;
    color: #409eff;
}

.auto-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #606266;
}

/* 通用聊天区域样式 */
.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f7fa;
}

.chat-message {
    margin-bottom: 12px;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 80%;
    word-break: break-word;
    line-height: 1.5;
}

.user {
    background: #ecf5ff;
    color: #409eff;
    margin-left: auto;
    text-align: right;
}

.ai {
    background: #f0f2f5;
    color: #606266;
}

/* 通用输入区域样式 */
.input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    background: white;
}

.input-field {
    flex: 1;
}

.send-btn {
    height: 36px;
}

.attachment-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    margin-top: 8px;
}
/* === 通用登录页面样式 === */
.login-container {
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
}

.login-form-wrapper {
    width: 450px;
    height: 400px;
    padding: 60px;
    background-color: white;
    border-radius: 20px;
    margin-top: 18%;
    margin-left: 60%;
}
/* === 通用导航菜单样式 === */
.nav-menu-container {
    height: 40px;
    line-height: 40px;
    background: #414040;
    border-bottom: 1px solid black;
    padding: 0 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-menu-container::-webkit-scrollbar {
    display: none;
}

.nav-menu-item {
    display: inline-block;
    cursor: pointer;
    font-size: 14px;
    height: 26px;
    line-height: 20px;
    background-color: #409eff;
    color: white;
    text-align: center;
    padding: 0.2vw 0.5vw 0.2vw 1vw;
    border-radius: 0.5vw;
    margin-right: 0.5vw;
    min-width: 60px;
}

.nav-menu-item.active {
    background-color: #42b983;
}

.nav-menu-close-btn {
    display: inline-block;
    width: 15px;
    height: 15px;
    line-height: 13px;
    border-radius: 50%;
    margin-left: 6px;
    text-align: center;
    font-size: 12px;
}

.nav-menu-close-btn:hover {
    background: #666;
}
/* === 通用侧边栏菜单样式 === */
.sidebar-menu {
    width: 200px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-menu.collapsed {
    width: 64px !important;
}

/* 平板设备适配样式 */
@media (max-width: 1024px) {
    .chart-container {
        height: 280px;
    }
    .login-form-wrapper {
        width: 400px;
        height: 380px;
        padding: 40px;
        margin-top: 15%;
        margin-left: 55%;
    }
    .sidebar-menu {
        width: 180px;
    }

    .sidebar-menu.collapsed {
        width: 54px;
    }
}

/* === 弹窗/对话框移动端适配 === */
@media (max-width: 768px) {
    .el-dialog {
        width: calc(100vw - 40px) !important;
        max-width: none;
        margin: 20px auto;
    }

    .el-dialog__body {
        padding: 15px !important;
    }

    .el-form-item__label {
        text-align: left !important;
    }

    /* 按钮堆叠 */
    .action-buttons,
    .search-buttons,
    .import-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons .el-button,
    .search-buttons .el-button,
    .import-actions .el-button,
    .import-actions .el-link {
        width: 100%;
        margin-bottom: 8px;
    }

    /* 输入框全宽 */
    .mobile-full-width {
        width: 100% !important;
    }

    /* 标签页导航高度微调 */
    .navMenuDiv {
        height: 36px;
        line-height: 36px;
        padding: 0 0.25rem;
    }

    .navMenuDiv p {
        font-size: 12px;
        padding: 2px 6px 2px 8px;
        min-width: 50px;
    }
    .chart-container {
        height: 250px;
    }
    .search-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-section .el-input,
    .search-section .el-select {
        min-width: auto;
    }
    .dialog-footer {
        flex-direction: column;
    }

    .dialog-footer .el-button {
        width: 100%;
        margin-bottom: 10px;
    }
    .search-and-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .export-button {
        width: 100%;
        align-self: auto;
    }

    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }
    .ai-chat-container {
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 20px) !important;
        left: 10px !important;
        top: 10px !important;
        border-radius: 10px;
        cursor: default;
    }

    .ai-chat-header {
        padding: 10px 12px;
        font-size: 16px;
    }

    .model-selector {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .model-cards {
        width: 100%;
        justify-content: space-between;
    }

    .auto-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .chat-box {
        height: calc(100% - 180px);
        padding: 10px;
    }

    .input-area {
        padding: 10px;
        flex-direction: column;
        gap: 10px;
    }

    .input-field {
        width: 100% !important;
    }

    .send-btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    .login-form-wrapper {
        width: calc(100% - 40px);
        height: auto;
        padding: 30px;
        margin: 15% auto;
        margin-top: 25%;
        margin-left: 20px;
    }
    .nav-menu-container {
        height: 36px;
        line-height: 36px;
        padding: 0 0.25rem;
    }

    .nav-menu-item {
        font-size: 12px;
        padding: 2px 6px 2px 8px;
        min-width: 50px;
    }

    .nav-menu-close-btn {
        width: 14px;
        height: 14px;
        line-height: 12px;
    }
    .sidebar-menu {
        width: 64px !important;
        transform: translateX(-100%);
    }

    .sidebar-menu.mobile-open {
        transform: translateX(0);
    }

    .sidebar-menu.collapsed {
        width: 64px;
    }
}
@media (max-width: 480px) {
    .chart-container {
        height: 200px;
    }
    .login-form-wrapper {
        padding: 20px;
        margin-top: 20%;
    }
}